import BaseModel from './MongoBaseModel';

class Model extends BaseModel<any> {
  constructor() {
    super('storyLock');
  }

  /**
   * 更新数据。如果没有则插入数据
   */
  async updateAdd(data: any, query: any) {
    const db = await this.init();
    return db.updateOne(
      query,
      {
        $set: data,
      },
      {
        upsert: true,
      },
    );
  }
}

export default new Model();
